perm filename NOTES.ARM[1,VDS] blob sn#126649 filedate 1974-10-22 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	CREATING FILES WHICH ARE ACCESSABLE BY THE ARM PROGRAMS
C00004 ENDMK
C⊗;
CREATING FILES WHICH ARE ACCESSABLE BY THE ARM PROGRAMS

given a program in SAIL-

 define strings   

STRING MOVE,PARK,OPEN, GOTO;

Assign values to variables in string

MOVE←"value ";

Alternative is to set up an array, this saves on assignment statements.

PRELOAD_WITH "PARK ","MOVE ","GOTO ";

OWN STRING ARRAY FUNCT[1:4];       funct is a one dim array 4 long

at run time FUNCT[1] has PARK  in it.

at the beginning ( or near there) put

DEFINE  CRLF="('15&'12)";      this terminates a line when multiple statements are sent to disk


now we start building up our string.

TEST← FUNCT[1

TEST← TEST & CRLF & GOTO ;

aall it takes to output on the disk is 

OPEN(1, "DSK",0,0,2,120,DUM, DUM);  where DUM  is defined earlier as INTEGER DUM;

this attaches the disk, channnel 1 , to my program.

now

ENTER(1,"TEST.YEL", DUM);


to write out my string, type

OUT(1,TEST);
RELEASE(1);   closes out disk file


if we want to make the output filename a variable, so each time we write out a new file, we can say.

CNT←1;


ENTER(1,"T"&CVS(CNT)&".YEL",DUM);

then make a loop to increment CNT
 

some other info.  
defining macros, like TRANS